package com.gt.quality.apim.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * API数据集表(ApiDataInfo)表实体类
 *
 * @author makejava
 * @since 2026-11-20 09:37:49
 */
@Data
@Accessors(chain = true)
@Schema(title = "ApiDataInfo", description = "API数据集表")
@TableName(value = "api_data_info", autoResultMap = true)
public class ApiDataInfo implements Serializable {
    @Serial
	private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(title = "id",description = "主键id")
    @JsonSerialize(using= ToStringSerializer.class)
    private Long id;

    @TableField(value = "api_name")
    @Schema(title = "api_name",description = "API数据集名称")
    @Max(value = 127,message = "名称取名过长,请考虑缩写或者简写")
    private String apiName;

    @TableField(value = "api_code")
    @Schema(title = "api_code",description = "API数据集编码")
    private String apiCode;

    @TableField(value = "api_req_method")
    @Schema(title = "api_req_method",description = "API-请求方式")
    private String apiReqMethod;

    @TableField(value = "api_desc")
    @Schema(title = "api_desc",description = "API数据集描述")
    private String apiDesc;

    @TableField(value = "api_url")
    @Schema(title = "api_url",description = "API地址:http://localhost:8080/test")
    @Max(value = 500,message = "URL过长,请考虑将参数放入请求体")
    private String apiUrl;

    @TableField(value = "api_success_result")
    @Schema(title = "api_success_result",description = "正常返回示例")
    private String apiSuccessResult;

    @TableField(value = "api_error_result")
    @Schema(title = "api_error_result",description = "异常返回示例")
    private String apiErrorResult;

    @TableField(value = "api_last_result")
    @Schema(title = "api_last_result",description = "最后一次执行结果")
    private String apiLastResult;

    @TableField(value = "api_query_timeOut")
    @Schema(title = "api_query_timeOut",description = "超时时间:3s")
    private Integer apiQueryTimeout;

    @TableField(value = "api_resp_type")
    @Schema(title = "api_resp_type",description = "响应结果类型：JSON/View")
    private String apiRespType;

    @TableField(value = "api_content_type")
    @Schema(title = "api_content_type",description = "请求类型")
    private String apiContentType;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(title = "create_time",description = "创建时间")
    private Date createTime;

    @TableField(value = "create_by")
    @Schema(title = "create_by",description = "创建人")
    private Long createBy;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(title = "update_time",description = "修改时间")
    private Date updateTime;

    @TableField(value = "update_by")
    @Schema(title = "update_by",description = "修改人")
    private Long updateBy;

    @TableField(value = "delete_flag")
    @Schema(title = "delete_flag",description = "0存在 1删除")
    @TableLogic(delval = "1",value  ="0")
    private Integer deleteFlag;

    @TableField(value = "create_dept")
    @Schema(title = "create_dept",description = "${column.comment}")
    private Long createDept;

}


